/*
 * @(#)AccessTokenConfig.java 2020/7/7
 *
 * Copyright (c) 2010 by rayootech.com. All rights reserved.
 */
package com.nuctech.auth.config;

import lombok.AllArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.oauth2.provider.token.TokenStore;
import org.springframework.security.oauth2.provider.token.store.InMemoryTokenStore;

/**
 * 修改 TokenStore 的实例
 *
 * @author lilu
 * @date 2020/7/7
 * @since 1.0.0
 */
@Configuration
@AllArgsConstructor
public class AccessTokenConfig {

//    private RedisConnectionFactory redisConnectionFactory;

    @Bean
    public TokenStore tokenStore() {
        // 存在内存中
        return new InMemoryTokenStore();
//        return new RedisTokenStore(this.redisConnectionFactory);
    }
}
